package com.ykt.model;

import com.jfinal.plugin.activerecord.Page;

import java.util.Map;

/**
 * 用户反馈
 * @author long.hua
 * @version 1.0.0
 * @since 2016-01-11 22:32
 */
public class UserFeedback extends BaseModel<UserFeedback>{
	private static final long serialVersionUID = 1L;

	public static final String user_id = "user_id";
	public static final String email = "email";
	public static final String feedback = "feedback";
	public static final String isread = "isread";

	public static final UserFeedback dao = new UserFeedback();

	@Override
    public Page<UserFeedback> paginate(int pageNumber, int rows, Map<String, String> paramMap) {
        String select = "SELECT u.name userName,u.phone userPhone, "
        		+ "uf.id,uf.email,uf.feedback, uf.created_time createdTime ";
        String exceptSelect = " FROM `user_feedback` uf left join `user` u on uf.user_id = u.id ";
        
        String sqlOrderBy = " ORDER BY uf.id DESC ";
        
        paramMap.put(OB, sqlOrderBy);
        
        return this.paginate(select, exceptSelect, pageNumber, rows, paramMap);
    }

}
